﻿<Window x:Class="QRCodeBasicsWPF.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:System="clr-namespace:System;assembly=mscorlib"
        Title="Color Basics" 
        Height="600" Width="700" 
        Loaded="MainWindow_Loaded"
        Closing="MainWindow_Closing"
        xmlns:converters="clr-namespace:QRCodeBasicsWPF.Converters"
        >
    <Window.Resources>
        <converters:JointTypesConverter x:Key="JointTypesConverter"/>
        <SolidColorBrush x:Key="MediumGreyBrush" Color="#ff6e6e6e" />
        <SolidColorBrush x:Key="KinectPurpleBrush" Color="#ff52318f" />
        <SolidColorBrush x:Key="KinectBlueBrush" Color="#ff00BCF2" />
        <Style TargetType="{x:Type Image}">
            <Setter Property="SnapsToDevicePixels" Value="True" />
        </Style>
    </Window.Resources>
    <Grid Margin="10 0 10 0">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <DockPanel Grid.Row="0" Margin="0 0 0 20">
            <Image DockPanel.Dock="Left" Source="Images\Logo.png" Stretch="Fill" Height="32" Width="81" Margin="0 10 0 5" />
            <TextBlock DockPanel.Dock="Right" Margin="0 0 -1 0" VerticalAlignment="Bottom" Foreground="{StaticResource MediumGreyBrush}" FontFamily="Segoe UI" FontSize="18">QRCode Color Basics</TextBlock>
            <Image Source="Images\Status.png" Stretch="None" HorizontalAlignment="Center" Margin="0 0 0 5" />
        </DockPanel>
        <Viewbox Grid.Row="1" HorizontalAlignment="Center">
            <Image Source="{Binding ImageSource}" Stretch="UniformToFill" />
        </Viewbox>
        <StackPanel Grid.Row="2" Orientation="Vertical">
            <TextBlock Text="QRCode zone analysis mode:"/>
            <StackPanel Orientation="Horizontal">
                <RadioButton x:Name="QRCodeMode_Full" Content="Full" IsChecked="True" Margin="10,0,0,0" GroupName="Mode" Checked="QRCodeMode_Checked"/>
                <StackPanel Grid.Row="2" Orientation="Horizontal">
                    <RadioButton x:Name="QRCodeMode_Joint" Content="Follow skeleton joint" Margin="10,0,0,0" GroupName="Mode" Checked="QRCodeMode_Checked"/>
                    <ComboBox x:Name="QRCodeSelectedJoint" Width="150" VerticalAlignment="Top" Margin="5,0,0,0"
                        ItemsSource="{Binding Converter={StaticResource JointTypesConverter}, Mode=OneWay}" SelectionChanged="QRCodeSelectedJoint_SelectionChanged"/>
                </StackPanel>
                <StackPanel Orientation="Vertical" Margin="10,0,0,0">
                    <RadioButton x:Name="QRCodeMode_PredefinedZone" Content="Manual"  GroupName="Mode" Checked="QRCodeMode_Checked"/>
                    <Grid Width="90" Height="90" x:Name="gridManualQRCodeZone" HorizontalAlignment="Left">
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <RadioButton Grid.Row="0" Grid.Column="0" Width="20" Height="20" GroupName="PredefinedZones" Checked="ToggleButton_Checked"/>
                        <RadioButton Grid.Row="0" Grid.Column="1" Width="20" Height="20" GroupName="PredefinedZones" Checked="ToggleButton_Checked"/>
                        <RadioButton Grid.Row="0" Grid.Column="2" Width="20" Height="20" GroupName="PredefinedZones" Checked="ToggleButton_Checked"/>
                        <RadioButton Grid.Row="1" Grid.Column="0" Width="20" Height="20" GroupName="PredefinedZones" Checked="ToggleButton_Checked"/>
                        <RadioButton Grid.Row="1" Grid.Column="1" Width="20" Height="20" GroupName="PredefinedZones" Checked="ToggleButton_Checked"/>
                        <RadioButton Grid.Row="1" Grid.Column="2" Width="20" Height="20" GroupName="PredefinedZones" Checked="ToggleButton_Checked"/>
                        <RadioButton Grid.Row="2" Grid.Column="0" Width="20" Height="20" GroupName="PredefinedZones" Checked="ToggleButton_Checked"/>
                        <RadioButton Grid.Row="2" Grid.Column="1" Width="20" Height="20" GroupName="PredefinedZones" Checked="ToggleButton_Checked"/>
                        <RadioButton Grid.Row="2" Grid.Column="2" Width="20" Height="20" GroupName="PredefinedZones" Checked="ToggleButton_Checked"/>
                        <RadioButton Grid.Row="0" Grid.Column="3" Width="20" Height="20" GroupName="PredefinedZones" Checked="ToggleButton_Checked"/>
                        <RadioButton Grid.Row="1" Grid.Column="3" Width="20" Height="20" GroupName="PredefinedZones" Checked="ToggleButton_Checked"/>
                        <RadioButton Grid.Row="2" Grid.Column="3" Width="20" Height="20" GroupName="PredefinedZones" Checked="ToggleButton_Checked"/>
                    </Grid>
                </StackPanel>
            </StackPanel>
        </StackPanel>

        <StatusBar Grid.Row="3" HorizontalAlignment="Stretch" Name="statusBar" VerticalAlignment="Bottom" Background="White" Foreground="{StaticResource MediumGreyBrush}">
            <StatusBarItem Content="{Binding StatusText}" />
        </StatusBar>
    </Grid>
</Window>
